package tech.wetech.admin3.chat.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import java.time.LocalDateTime;

@Data
public class MessageDto {
  /**
   * 消息文本内容
   */
  private String text;
  /**
   * 是否为自身发送的消息
   */
  private boolean isSelf = false;
  /**
   * 是否为系统消息
   */
  private boolean isSystem = false;
  /**
   * 消息发送时间
   */
  @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
  private LocalDateTime time = LocalDateTime.now();

  public MessageDto() {
  }

  public MessageDto(String text) {
    this.text = text;
  }

  public MessageDto(String text, boolean isSelf) {
    this.text = text;
    this.isSelf = isSelf;
  }

  public MessageDto(String text, boolean isSelf, boolean isSystem) {
    this.text = text;
    this.isSelf = isSelf;
    this.isSystem = isSystem;
  }
}
